<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def page_exists_on_disk(self, slug):
        '''Return true if post directory and post file both exist.'''

        r = False
        page_dir = os.path.join(self.dirs['source'], slug)
        page_file_name = os.path.join(page_dir, slug + '.md')
        if os.path.isdir(page_dir):
            if os.path.isfile(page_file_name):
                r = True
        return r