chriskyfung / amp-affiliately-jekyll-theme Goto Github PK
View Code? Open in Web Editor NEWAn AMP-Ready Jekyll Blog Theme
Home Page: https://chriskyfung.github.io/amp-affiliately-jekyll-theme/
License: MIT License
An AMP-Ready Jekyll Blog Theme
Home Page: https://chriskyfung.github.io/amp-affiliately-jekyll-theme/
License: MIT License
I change the favicon (I deleted the default favicon and replace with new one with the same link structure '/favicon.png and /favicon.webp') but shows nothing on the home page and when visited posts the default favicon show
And the /tag/, /category/ and/blog/ shows error
And how can I customize 404
Create the missing 404 page template
.beforefooter
section[x] pre-release version (v2.1.2-alpha)
[ ] doc and demos
We're experiencing a CORS policy error when trying to load an image from 'https://icon-library.com/images/b8d82a619c.png' on our website 'https://chriskyfung.github.io'. The error is being thrown because the server hosting the image lacks the 'Access-Control-Allow-Origin' header.
The image should load correctly without any CORS policy errors.
The image is not being loaded due to a CORS policy error. The browser is blocking the resource from being loaded due to the absence of the 'Access-Control-Allow-Origin' header.
To fix this issue, we have two possible solutions:
The issue is reproducible in the Microsoft Edge browser.
The CORS policy error needs to be resolved as it's preventing the image from being loaded on our website, which could impact the user experience.
Here are the steps to host the image on the same domain as your website:
Download the Image: First, you need to download the image from 'https://icon-library.com/images/b8d82a619c.png'. You can do this by navigating to the URL, right-clicking on the image, and selecting 'Save Image As...'.
Upload the Image to Your Server: Next, you need to upload the downloaded image to your server.
Update the Image URL: Once the image is uploaded to your server, it will have a new URL. You need to update the image URL in your website's code. For example, if your website is 'https://chriskyfung.github.io' and you uploaded the image to an 'images' directory, the new URL might be 'https://chriskyfung.github.io/amp-affiliately-jekyll-theme/assets/images/b8d82a619c.png'.
Test the Image: Finally, you should test the image by navigating to your website and ensuring the image loads correctly. If you still see the CORS error, make sure the image URL is correct and the image was uploaded successfully.
By hosting the image on your own domain, you avoid the CORS policy issue because the image is no longer being loaded from a different origin. This is a common solution to CORS errors when you have control over the server where the resources are hosted. Please note that this method requires that you have the necessary permissions to host and distribute the image. If the image is copyrighted, you should seek permission from the copyright holder before hosting it on your own server.
The Viglink integration used in this theme is no longer supported and may cause issues with website's performance and security. Therefore, we drop all the outdated Viglink integration from the AMP Affiliately Jekyll Theme.
Expected Result:
All outdated Viglink integration should be removed from the AMP Jekyll theme.
Priority: High
Following the configuration guide the categories
and tags
are not being displayed or generated.
I also checked your gh-pages
branch and it seems that both categories and tags are actually new pages, not something generated via jekyll.
The AMP validator reports two errors for the redirect pages, like this:
FAIL: <path>\index.html
line 1, col 224: The attribute 'http-equiv' may not appear in tag 'meta'. (see undefined)
line 3, col 385: Custom JavaScript is not allowed. (see https://amp.dev/documentation/guides-and-tutorials/learn/validation-workflow/validation_errors/#custom-javascript-is-not-allowed)
npm run build
The redirect pages should pass the AMP validation without any errors.
The redirect pages fail the AMP validation with two errors.
To solve the AMP validation errors in the redirect template, follow these steps:
<meta http-equiv="...">
tag. This tag is not allowed in AMP documents, as it can interfere with the AMP cache and the browser's rendering.<script>
tag with an <amp-script>
tag. This tag allows you to run custom JavaScript in AMP documents, as long as you follow the amp-script guidelines.When using AMP optimizer to process our Jekyll site built with Gulp, we encounter a number of warning messages like this: AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to .
We have traced the source of the issue to the jekyll-redirect-from plugin, which generates redirect pages with missing the HTML <head>
and <body>
tags. This is incompatible with the AMP optimizer and causing issues in the AMP pages.
_config.yml
fileredirect_from
entries to some pages or postsgulp
to build the site and run the AMP optimizerThe redirect pages should have absolute URLs for their canonical links, and the AMP optimizer should not show any warning messages.
The AMP optimizer cannot ampify the redirect pages appropriately and shows warning messages like this: AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to .
One possible solution is to customize the redirect template for the jekyll-redirect-from plugin. We can copy the redirect.html file to the _layouts
directory under the Jekyll project. In the custom redirect template, we then add back the HTML <head>
and <body>
tags.
_layouts
directoryThe current Jekyll theme includes Google Analytics tracking using the Universal Analytics (UA) property. However, UA is outdated and will be discontinued in July 2023. We should update the theme to use the Google Analytics 4 (GA4) property instead to ensure continued tracking.
Issue Type: Enhancement
Priority: High
Due Date: Before July 1, 2023
Title: Implement Granular Consent UI for GDPR Compliance
The current AMP-ready Jekyll theme includes services that utilize cookies to store user data. To ensure compliance with the General Data Protection Regulation (GDPR), we need to implement a granular consent UI that allows users to control their cookies on a per-purpose basis.
The theme does not currently provide users with a way to opt in or out of specific cookie purposes, which could result in non-compliance with GDPR requirements.
We propose implementing a Consent UI that includes the following features:
One possible implementation could involve using a third-party consent management platform (CMP) that is AMP-compatible. CMPs provide a range of features out-of-the-box, including granular consent options, data collection, and reporting.
Another approach could be to develop a custom Consent UI using AMP elements. This would require more development effort but could provide greater control over the UI's design and functionality.
Implementing a granular Consent UI will provide the following benefits:
This feature should be prioritized and completed within the next sprint.
To be assigned after discussion and review of proposed implementations.
Phase 1: Design and Development
Phase 2: Integration and Testing
Phase 3: Deployment and Maintenance
When using the Jekyll Archives plugin to generate archive pages for categories and tags, it creates multiple files with the same name in the _site
directory, causing a conflict. For example, the following destination is shared by two files:
./amp-affiliately-jekyll-theme/_site/category/doc/index.html
- category/doc/index.html
- category/doc/index.html
This results in unexpected contents in the written file, and may affect the functionality of the site.
bundle exec jekyll serve
or jekyll serve
to build the site locally._site
directory and find the duplicate files.The Jekyll Archives plugin should generate only one file per destination, and avoid creating duplicate files in the _site
directory.
Upon inspection, it was found that the source directory contains a duplicate file that matches the archive path. The file is configured to provide the URL redirection from category/guide/
to category/to/
.
To resolve this issue, we may rename the category/doc
to category/guide
and set the redirection using the front matter redirect_to
instead of redirect_from
.
Jekyll is a static site generator that uses Liquid as its templating language. Liquid has a tag called include
that allows you to insert the content of another file into your current file. For example, you can use {% include footer.html %}
to insert the content of footer.html
into your page.
However, when you use include
just after a list item, you may encounter an indent issue. This is because Liquid preserves the whitespace and indentation of the included file, which may not match the indentation of the list item. For example, if your footer.html
file has four spaces of indentation, and your list item has two spaces of indentation, the result will look like this:
To fix this issue, you have two options:
You can remove the indentation from the included file, so that it aligns with the list item. For example, if your footer.html
file looks like this:
This is a footer
You can change it to this:
This is a footer
You can use the strip
filter to remove the leading whitespace from the included file. For example, you can use {% include footer.html | strip %}
to insert the content of footer.html
without any indentation. This will result in the following output:
This is a list item
{% include footer.html | strip %}
Uncrawlable Link
a.nav-link.dropdown-toggle
Hello, could you pls help me with my issue.
I install your perfect theme, but if i tried to go to nav menu links: /category/ /tag/ /cloud/ i got empty page..
Shall i need to Add some .md files to root directory for this to work?
And one more question - could you please describe what it's for a file .post-template (in root directory)?)
References:
The amp-addthis extension is no longer maintained and has been deprecated. It is recommended to drop this extension and its associated components from the codebase for the following reasons:
_config.yml
file.This change should be implemented within the next release of the Jekyll theme.
We are encountering an error in the DevTools console related to resource preloading. The specific error message is:
A preload for 'https://chriskyfung.github.io/amp-affiliately-jekyll-theme/assets/images/logo-plainSVG.svg' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
This error indicates a mismatch between the request credentials mode and the 'crossorigin' attribute in the <link rel="preload">
tag.
The resources should be preloaded correctly without any errors in the console.
The browser found a preload link for 'logo-plainSVG.svg' but didn't use it due to a credentials mode mismatch.
We need to adjust the 'crossorigin' attribute in the <link rel="preload">
tag to match the credentials mode. This could be 'anonymous' or 'use-credentials', depending on the requirements of the resource being preloaded.
Please ensure to test the changes in Microsoft Edge as the error was identified in this browser.
AMP validation fails for all pages that use the ‘amp-link-rewriter’ extension, which is no longer needed after dropping the Viglink integration in PR #45.
AMP validation should pass for all pages without any errors or warnings related to the ‘amp-link-rewriter’ extension.
Run npm test
in the terminal to run the AMP validator.
Observe the error messages for each page that uses the ‘amp-link-rewriter’ extension, such as:
FAIL: blog\example\index.html
line 674, col 0: The extension 'amp-link-rewriter' was found on this page, but is unused. Please remove this extension. (see undefined)
Remove the ‘amp-link-rewriter’ extension from the pages that use it, and update the tests accordingly.
npm test
and confirm that AMP validation passesThis issue is related to PR #45, which removed the Viglink integration that required the ‘amp-link-rewriter’ extension.
We are using Disqus to power the comment system for our AMP-based Jekyll theme. However, Disqus is showing unwanted ads on our website that we do not have control over. We want to hide these ads with CSS.
We expect to see only the comments and no ads.
We see ads above and below the comments.
We can hide the ads iframes with CSS by using the following selector:
iframe[src*="ads-iframe"] {
display: none;
}
The data-ampdevmode
attribute is being used on an <amp-script>
tag in production code, which can lead to unintended behavior, such as:
<amp-script src="https://example.com/script.js" data-ampdevmode></amp-script>
Publish the page and load it in a browser.
Inspect the network requests and observe that the script is being loaded from the development server instead of the production server.
The data-ampdevmode
attribute should only be used in development environments and not in production. A script hash should be used to verify that the custom script and included in a meta[name=amp-script-src]
element in the document head.
The amp-script does not run in production because the data-ampdevmode
attribute is present.
Remove the data-ampdevmode
attribute from the <amp-script>
component in production environment.
Access to image at 'https://icon-library.com/images/b8d82a619c.png' from origin has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
[ ] coding
[ ] test version
[ ] doc
Alternative:
TOC button
The theme's documentation website lists the jekyll-gist package as one of the whitelisted packages that can be used with the theme. However, this package is incompatible with AMP, and it renders script tags that break AMP validation and page layout.
The documentation website should remove the jekyll-gist package from the whitelist package list, and warn users not to use this package with the AMP-really theme. Instead, the documentation website should recommend alternative methods to embed GitHub gists in posts and pages, such as using the <amp-gist>
component.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.