ampl icon indicating copy to clipboard operation
ampl copied to clipboard

Allow custom header

Open michaelmior opened this issue 9 years ago • 10 comments

It would be great if it were possible to customize the header somehow. It seems like right now you can't even change the title of the page.

michaelmior avatar Mar 23 '16 02:03 michaelmior

@michaelmior agree. that would be super useful. @des-des what is the plan for customising the templates?

nelsonic avatar Mar 23 '16 08:03 nelsonic

I am not sure what people need as far as customising headers. Obvs not being able to set the title is a problem, I'll make a pull tonight!

des-des avatar Mar 23 '16 10:03 des-des

@michaelmior Feel free to elaborate on suggested requirements!

@des-des Thanks!

iteles avatar Mar 23 '16 16:03 iteles

Thanks for the quick responses all! I'm enjoying ampl so far. My current use case is to integrate it with my static site generator so I can automatically produce AMP-enabled portions of some of my pages. There are a couple things I can think of off the top of my head that would be useful:

  • Allow generation of only the body of the page (this would make the user responsible for providing a header which results in a valid AMP document, but gives a lot more flexibility)
  • Allow the insertion of additional content in the head of the document

michaelmior avatar Mar 23 '16 18:03 michaelmior

Another important thing I realized is that there should be a way to specify the canonical URL.

michaelmior avatar Mar 24 '16 00:03 michaelmior

@michaelmior can you please confirm if this change https://github.com/dwyl/ampl/commit/154197f5ebe94d4f817d6fa8ba8a3949b0f98f73 serves your purpose. thanks! :+1:

nelsonic avatar Apr 06 '16 10:04 nelsonic

It looks like it does :) Although I've since decided that it's easier for me to just build all the AMP HTML myself so I'm not currently using ampl. I think there's still potential for it to be very useful. This change is definitely a step in the right direction.

michaelmior avatar Apr 06 '16 14:04 michaelmior

@michaelmior what made you decide to build the AMP HTML features yourself? What is/was your use-case? is there anything we can add/remove from ampl to make it fit your needs better?

nelsonic avatar Apr 06 '16 16:04 nelsonic

Those are the right questions to ask :) I decided to produce an AMP version of my personal blog. I didn't need any of the image features provided by ampl and I needed some header customizations. This meant I wasn't really deriving a lot of benefit. It might be helpful to include easy ways to add other components such as amp-analytics.

If you're curious, the source is public and you can view the template I use for AMP pages.

michaelmior avatar Apr 07 '16 17:04 michaelmior

@michaelmior thanks that's really helpful. :)

nelsonic avatar Apr 08 '16 08:04 nelsonic