fdoc

subroutineindex_pageprivate

subroutine index_page(site, front, html)

Render the front page.

Arguments

NameTypeIntentAttributesDescription
sitetype(site_t)in

the site

frontcharacter(len=*)in

the project file's text as HTML

htmlcharacter(len=:)outallocatable

the page

Calls

Source

Show the code
subroutine index_page(site, front, html)
    type(site_t), intent(in) :: site                    !! the site
    character(len=*), intent(in) :: front               !! the project file's text as HTML
    character(len=:), allocatable, intent(out) :: html  !! the page
    type(buffer_t) :: b
    character(len=:), allocatable :: name
    integer :: k

    associate (s => site%s)
        call page_head(site, s%project, 0, '', index(front, 'math/tex') > 0, b)
        call add(b, '<aside class="side">'//achar(10))
        call site_side(site, 0, '', b)
        call add(b, '</aside>'//achar(10)//'<main><div class="inner">'//achar(10))
        call logo_name(s, name)
        if (len(name) > 0) then
            call add(b, '<div class="hero with-logo">'//achar(10)//'<img class="hero-logo" src="')
            call html_escape(name, b, .true.)
            call add(b, '" alt="">'//achar(10))
        else
            call add(b, '<div class="hero">'//achar(10))
        end if
        call add(b, '<h1>')
        call html_escape(s%project, b, .false.)
        call add(b, '</h1>'//achar(10))
        if (allocated(s%summary)) then
            call add(b, '<div class="lead">')
            call html_escape(s%summary, b, .false.)
            call add(b, '</div>'//achar(10))
        end if
        call add(b, '<div class="project-links">')
        call icon_link(s%project_github, 'github', 'Source on GitHub', b)
        call icon_link(s%project_gitlab, 'gitlab', 'Source on GitLab', b)
        call icon_link(s%project_bitbucket, 'bitbucket', 'Source on Bitbucket', b)
        call icon_link(s%project_sourceforge, 'sourceforge', 'Source on SourceForge', b)
        call icon_link(s%project_website, 'website', 'Project website', b)
        call icon_link(s%project_download, 'download', 'Download', b)
        call add(b, '</div>'//achar(10)//'<div class="meta">')
        if (allocated(s%author)) then
            call add(b, '<span>')
            call html_escape(s%author, b, .false.)
            call add(b, '</span>')
        end if
        call add(b, '<span class="author-links">')
        call icon_link(s%github, 'github', 'Author on GitHub', b)
        call icon_link(s%gitlab, 'gitlab', 'Author on GitLab', b)
        call icon_link(s%bitbucket, 'bitbucket', 'Author on Bitbucket', b)
        call icon_link(s%linkedin, 'linkedin', 'Author on LinkedIn', b)
        call icon_link(s%twitter, 'twitter', 'Author on X', b)
        call icon_link(s%facebook, 'facebook', 'Author on Facebook', b)
        call icon_link(s%website, 'website', 'Author website', b)
        if (allocated(s%email)) then
            call add(b, '<a class="icon-link icon-email" title="Email the author" aria-label="Email the author" href="mailto:')
            call html_escape(s%email, b, .true.)
            call add(b, '"></a>')
        end if
        call add(b, '</span>')
        call add(b, '</div>'//achar(10)//'<div class="grid">')
        do k = 1, NUM_LISTS
            if (size(site%members(k)%ids) == 0) cycle
            call add(b, '<a class="card" href="lists/'//trim(LIST_FILE(k))//'.html"><b>'// &
                     trim(int_text(size(site%members(k)%ids)))//'</b><span>'//trim(LIST_TITLE(k))//'</span></a>')
        end do
        call add(b, '</div>'//achar(10)//'</div>'//achar(10)//'<div class="doc">'//achar(10))
        call add(b, front)
        call add(b, achar(10)//'</div>'//achar(10))
        call page_foot(site, b)
    end associate
    call take(b, html)
end subroutine index_page

Graphs

Calls

Called by