Giter Club home page Giter Club logo

kentico-amp's People

Contributors

devagarwal007 avatar dmytrokuzmin avatar helloausrine avatar janapel avatar kentico-timothyf avatar kile-lindgren avatar kordys avatar manhhungtran avatar marecekf avatar petrsvihlik avatar richardkalinec avatar simply007 avatar skurekjakub avatar surfinzap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kentico-amp's Issues

Replace HtmlAgilityPack with AngleSharp

Problem definition

While Kentico 11 CMS App has a dependency on AngleSharp, Kentico AMP uses HtmlAgilityPack, which provides a similar functionality. It's redundant to have both.

Suggested solution

Get rid of the HtmlAgilityPack dependency and replace it with AngleSharp.
Note: AngleSharp does not support XPaths, the code needs to be rewritten to LINQ for AngleSharp.

Resolve <picture> tags

It's common that Kentico generates picture tags with several sources. The following syntax (which can be found on the Dancing Goat sample site) is not a valid AMP:

<picture>
    <source media="(max-width: 767px)" srcset="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx?variant=large"></source>
    <source media="(min-width: 768px) and (max-width: 1111px)" srcset="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx?variant=small"></source>
    <source media="(min-width: 1112px)" srcset="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx?variant=medium"></source>
    <amp-img class="article-tile-image" src="/Kentico10webapp/getattachment/4aeae1fa-1cbe-4d28-9523-fc9b754ed379/teaser.aspx" alt="Article Coffee processing techniques"></amp-img>
</picture>

The validator says:

The tag 'picture' is disallowed.

The markup should resolve into one of the defined sources. Ideally, to the one with the lowest resolution.

A new replacement logic will have to be added to [TransformToAmpHtml()](

private string TransformToAmpHtml(string finalHtml)
.

Bug in instructions

You have in the instructions that we go to
Settings -> Content -> Output filter -> AMP Filter

Should be
Settings -> System -> Output filter -> AMP Filter

Global
Settings -> System -> Output filter -> AMP Filter seems to have more options for setting the script URL. Most people will not need to change.

Deploy to Kentico Marketplace?

I'm very unfamiliar with standard practices with submitting git "issues" but i couldn't find a way to just contact someone directly with this question:

Would it be possible to deploy this as a module within the Kentico Markeplace and if not, is it possible to export this module from one kentico instance and import it via the Kentico Portal in another instance of the same exact version?

Spike: MVC

Would it be possible to re-use some of the functionality for Kentico MVC?

Single place for settings

There should be a single class containing setting accessors. This helps to find occurrences when refactoring. E.g. AMPFilterDomainAlias is being queried on multiple places.

AMP pages Canonical URL macros not resolving

We have implemented the AMP Module in our site based on the below reference link and our site running on kentico 10 version and the Nuget package version we used for AMP module is Kentico.AcceleratedMobilePages/1.0.3.

Ref: https://devnet.kentico.com/articles/google-amping-the-kentico-advantage-site

We have an issue in our site while browsing the page we are getting wrong URL as canonical URL.
We have given custom URL pattern to our page.
In that custom URL we given a macros like "/amp/{sectionname}/{mm}/{dd}/{yy}/{title}", so the canonical URL displaying

the same path instead of page URL.
Below are the steps to reproduce the issue on live site.

Kindly help me to get the correct canonical url display or to remove the canonical URL link.
custom url path

Allow AMP on relative paths

Currently, the AMP pages can be located only on different domains or subdomains.
original: http://domain.tld/my-blogpost
amp: http://amp.domain.tld/my-blogpost
alt amp: http://different.tld/my-blogpost

It should be possible to set it up so that the AMP pages are served from the same domain as where the original content is located.

original: http://domain.tld/my-blogpost
amp: http://domain.tld/amp/my-blogpost
alternatively: http://domain.tld/my-blogpost/amp

Related to #4

Support virtual directories

If the application runs on http://localhost/Kentico10 and I set the AMP domain to amp.localhost.com, the link pointing to AMP version of a page is generated incorrectly:

<link rel="amphtml" href="http://amp.localhost.com/Home" />

instead of

<link rel="amphtml" href="http://amp.localhost.com/Kentico10/Home" />

The module should be adjusted to support this scenario. This method is the starting point for fixing.

Relates to: #4

Spike: Images

  1. Would it be possible to somehow generate width and height for images automatically?
  2. Could we somehow leverage image variants?

Latest bug fixes for Kentico 11 version of AMP module not included in K11 NuGet release

Brief bug description

In a Kentico 11.0.49 site, I installed the K11 release of the Kentico.AcceleratedMobilePages module via NuGet. The generated AMP tag includes the specified AMP domain, and all the URL friendly extensions for the site. (http://amp.local.wfdev.net;;.aspx;.html;.xml;.txt)

I think this may have been fixed in #31, but that fix doesn't seem to be pulled down in the Kentico 11 version of the module.

Repro steps

  1. Open a K11 site in Visual Studio
  2. Right click on the solution and "manage NuGet Packages for Solution"
  3. Select the "Browse" tag, and get "Kentico.AcceleratedMobilePages"
  4. Install version 11.0 of the AMP module
  5. Go into the admin section of the site, Settings > System > Output Filter. Enable AMP, and specify an AMP domain alias
  6. In the Pages app, select a page (e.g. "/thewire"), go to the "AMP filter" properties tab. Select "Enable AMP for this page"
  7. View source for domain.com/thewire. There is an amphtml tag with an href of amp.domain.com;;.aspx;.html;.xml;.txt

Expected behavior

domain.com/thewire should have an amphtml tag with an href of amp.domain.com/thewire

Test environment

  • Platform/OS: Windows 10, Kentico 11.0.49
  • Browser: Firefox
  • Version 11.0.0

Additional context

I'm hoping the Kentico 11 release of this module can be updated to include the bug fixes made before it was ported to Kentico 12.

Can't submit Kentico on-line form on AMP page

I'm getting the following error in the browser's console window when a basic Kentico form is submitted on an AMP.

Response must contain the AMP-Access-Control-Allow-Source-Origin header

From the documentation, I'm not seeing any steps to allow basic form submissions on an AMP. I also see that on my phone, the amp.advantage.kentico.com site's search functionality leads to a 404 page so I'm not currently seeing any working examples of a Kentico on-line form on an AMP.

Any help or insight you can provide would be greatly appreciated.

amp issue

amp issue 2

Incorrect usage of CMSFriendlyURLExtension

The CMSFriendlyURLExtension setting can be one extension (e.g. .aspx), but it can also be list of extensions separated by semicolon (e.g. .aspx;.html;.htm).

The list of extensions is not taken into account in code using this setting, e.g.

SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSFriendlyURLExtension");

Review usage of the setting and in case of more extension, use just first one.

Validator flagging DOCTYPE - using macro not working

The default DOCTYPE declaration for the master page in Kentico is DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

I'm getting a number of errors relating to this when I validate my accelerated mobile page. I tried using the macro to determine what the DOCTYPE declaration should be but it's not actually evaluated and produces a similar validation error.

Validation Error Example:

Prohibited or invalid use of HTML Tag
The attribute '"-//w3c//dtd' may not appear in tag 'html doctype'.
1 instance
Line 1:0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/

Another Example:

The attribute '!ampfilter.isamppage()' may not appear in tag 'html doctype'. (see https://www.ampproject.org/docs/reference/spec#required-markup)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.