Today while browsing Webmaster Tools, I decided to look into AMP in more detail. I seen it before but it always thought I didn't need such a thing.
Will I decided to play around with it according to the standard and did a little buffer rewriting.
function amp_rewrite_buffer($buffer) {
// Allowed with formatting, this code needs to be better.
$ctamp = array('img','video','audio','iframe');
foreach ($ctamp as $item)
$buffer = str_replace('<'.$item, '<amp-'.$item, $buffer);
$doc = new DomDocument();
$doc->loadHTML($buffer);
$xpath = new DOMXPath($doc);
// Script is not allowed only if it is ld+json
while($node = $xpath->query('//script[@type!="application/ld+json" or not(@type)]' )->item(0))
$node->parentNode->removeChild($node);
// Not allowed elements
$remove = array('frame', 'frameset', 'object', 'param', 'applet', 'embed','form');
foreach($remove as $item)
while($node = $xpath->query('//'.$item)->item(0))
$node->parentNode->removeChild($node);
//button is allowed, no documentation on radio though.
$types = array('input','textarea','select','option');
foreach($types as $type)
while($node = $xpath->query('//input[@type="'.$type.'"]')->item(0))
$node->parentNode->removeChild($node);
// Send the doc from the dom back to the buffer
$buffer = $doc->saveHTML();
// We do this last for a reason.
$buffer = str_replace('</head>', '<script async src="https://cdn.ampproject.org/v0.js"></script><style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript></head>', $buffer);
return $buffer;
}
This doesn't render the page fully compliant and it doesn't look all that pretty without all that script and html charm that was removed.
After all, I was just thinking wouldn't it be easier just making a mobile template. ::)
What are your ideas and opinions about AMP.
If form isn't allowed, posting isn't going to work.
Neither is quick moderation, or logging in...
Nope... http://www.xda-developers.com/accelerated-mobile-pages-what-are-they-and-how-do-i-implement-them/#index It requires too much for already established software, and I don't think it has huge difference compared to responsive. Another Google boosted project.
I went ahead and implemented this a while back and looks like it does have some SEO benefits on Google on mobile. I didn't use the code I posted above and went the template route.
The page below and a screen shot of the search listing on mobile, beat Wikipedia for the search phrase.
http://www.sicomm.us/a/amp/?m=97
And here is a topic view.
http://www.sicomm.us/a/amp/?t=180
You're also using personalised data which will also bias places you've already been above places you haven't been so much - as shown by the 'you went here on xxx' - which sort of makes it hard to use as evidence that, objectively, it improved things.
Quote from: Arantor on October 12, 2016, 03:27:30 AM
You're also using personalised data which will also bias places you've already been above places you haven't been so much - as shown by the 'you went here on xxx' - which sort of makes it hard to use as evidence that, objectively, it improved things.
True, I forgot to take that into consideration.
Search Console report shows increase in CTR over one month span.
All,
Is there any AMP theme/template available for Simple Machines? If not, is it a good idea to develop one?
Rickey
I am looking for a theme with AMP integrated. Are there any?
Sorry I was hoping someone would of picked this up as I released all the required source code to get this working.
http://www.simplemachines.org/community/index.php?topic=549622.0
If no one is interested, I will go ahead and put this together as a modification.
smf AMP ;)
http://www. vizszerelo-budapest.hu/amp/amp-index.html
Akit esetleg érdekel magyar nyelven tudok instrukciókat adni, vagy elérhetőséget ahhoz aki csinálta, bár ehhez a készítő beleegyezése is kelleni fog majd
Quote from: rumosdio on January 09, 2017, 04:26:32 PM
smf AMP ;)
http://www. vizszerelo-budapest.hu/amp/amp-index.html
Akit esetleg érdekel magyar nyelven tudok instrukciókat adni, vagy elérhetőséget ahhoz aki csinálta, bár ehhez a készítő beleegyezése is kelleni fog majd
Looks like you got it going. The only issue I can see is you have your canonical's pointing to the board index and not the actual topic. The AMP documents will be penalized for having mismatched content and possibly not indexed.
I had a similiar problem a few days ago. However in my case I believe Google happened to be browsing along on two occasions and caught error pages while I was uploading new sources to the server. It was only a couple of AMP documents and I have resubmitted them, so hopefully they'll be back up soon. See attachment below.
custom development.
It has been modified in the comments.
AMP generated from the data in the file.
We do not deceive Google, but ordinary AMP is generated.
---------------------
by google translate
egyedi fejlesztés.
a hozzászólások lett módosítva.
onnan generálódnak az adatok az AMP fájlnak.
Nem becsapjuk a google-t, hanem rendes AMP van generálva.
I want to use AMP on my forum ( https://www.neoweb.nl/forum2 ) but how do I implement it?
Google is also suggesting using an AMP plugin for wordpress... but SMF =! Wordpress :(
Quote from: neoweb on November 23, 2017, 09:25:00 AM
I want to use AMP on my forum ( https://www.neoweb.nl/forum2 ) but how do I implement it?
Google is also suggesting using an AMP plugin for wordpress... but SMF =! Wordpress :(
Look like a AMP SMF plugin is necessary.
Have you tried this one?
https://www.simplemachines.org/community/index.php?topic=549622.0
Forgive me for re-opening this, but the two links posted here are both dead. Have the projects been abandoned? AMP does make a difference and I would very much like to be able to use SMF with it.
AMP makes a difference in that it's easier for Google to make money off your content.
A slightly acerbic (and a little hyperbole-laden) take on it - https://www.theregister.co.uk/2017/05/19/open_source_insider_google_amp_bad_bad_bad/
Though I have yet to see any evidence that this quote is wrong:
QuoteGoogle AMP is a Google project designed such that you must restrict your layout options, forgo sending visitors to your website and accept whatever analytics data Google is willing to share.
It's also fairly good at discouraging people from responding to posts on your forum...
Please we need AMP for SMF. About 70% Amp now index on SEO. Any mod for this please
That would be awesome ;D
You can grab from https://github.com/sicommnend/SMF-AMP
That package gives me:
1. Execute Modification install.xml Modification parse error
2. Extract File ./Sources/Amp.php
3. Extract File ./Themes/default/Amp.template.php
NVM doesn't look it was finished.
Quote from: vbgamer45 on May 10, 2020, 04:24:43 PM
NVM doesn't look it was finished.
Do you mean the mod is not yet completed?
exactly not done.
Quote from: vbgamer45 on June 05, 2020, 12:18:50 AM
exactly not done.
Quote from: Antes on June 06, 2020, 09:27:58 AM
Before you ask
yes, this is a scuffed version of Printpage (you can see the comments in it)
no, I have no idea what I am doing...
no, there won't be a SMF 2.0 version of it -even paid-*
yes, It works...
v0.0.1 - this means something, expect nothing!
[ Demo (https://www.wowsnips.xyz/smfnext/index.php?action=amp;topic=2) ] # [ Result (https://search.google.com/test/amp?id=tUWpsZCFGYAG_UaoiMAa6g) ]
* Its licensed under MIT go port it... if you want to chip in some $$ do by my patreon
Remember if something is broken, its not my fault it was working last I checked... if its working good...
Mod licensed under: MIT
@Antes has come up with the AMP version for smf 2.1. kindly help us with the SMF 2.0 version
Thanks!!
OK: https://www.simplemachines.org/community/index.php?topic=573591.0;topicseen