artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can index.html be made the default page?


From: Nala Ginrut
Subject: Re: Can index.html be made the default page?
Date: Tue, 15 Dec 2020 21:03:24 +0800
User-agent: mu4e 1.4.13; emacs 27.1

Although I can add default index handler in route system, you will lose
the chance to render `index.html' as a HTML template, since the
render requires `the-environment' to capture variables in your current
context.

But anyway, I will add this feature into route system. Because folks may
just want to render the page with front-end framework like
React. Personally, I use both backend template and React. And some folks
don't like front-end rendering at all.

Best regards.

Mortimer Cladwell writes:

> Thanks Nala.
> That will work for the first page but what if the user is navigating the
> help pages? Every page has a sidebar with categories and tags which are all
> hyperlinks to a directory. Each page has embedded hyperlinks to other
> pages. As the user browses, I would have to intercept all mouse clicks to
> process the URL.
>
> Looks like Hexo provides the option of including the index.html.  Does not
> work for tags and categories but there may be a possible hack.
> Thanks
> Mortimer
>
> On Mon, Dec 14, 2020 at 7:58 PM Nala Ginrut <mulei@gnu.org> wrote:
>
>>
>> Hi Mortimer!
>> Currently, you may do it like this:
>> --------------------code--------------------
>> (help-define "about" (view-render "index" (the-environment)))
>> --------------------end---------------------
>>
>> I don't have a better idea to do it automatically, since
>> `the-environment` has to be captured inside the handler function. So you
>> can't define a function to render index template. But if you define it
>> as a macro, you can't pass it in.
>>
>> I'm open with a better idea.
>>
>> Best regards.
>>
>>
>> Mortimer Cladwell writes:
>>
>> > Hi,
>> >
>> > I would like to serve the help files for my application with Artanis.  My
>> > help system generator (Hexo, static website generator) generates one
>> > directory per page and assumes the default HTML page is index.html e.g.
>> if
>> > I want to load my About page I would navigate to
>> > http://localhost:3000/help/about and
>> > http://localhost:3000/help/about/index.html is automatically loaded.
>> > Is there a way to instruct Artanis to look for index.html if the .html is
>> > not provided?
>> > Thanks
>> > Mortimer
>>
>>
>> --
>> GNU Powered it
>> GPL Protected it
>> GOD Blessed it
>> HFG - NalaGinrut
>> Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058
>>


--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]