Comments (5)
Since this is a theme, would this be as relevant? I should think the theme would have minimal logic. I think it should look a lot like any PHP logic that is found in _s or any of the core themes. Namely: prefixed global functions.
from ampnews.
Correct, there will things like theme support, potentially reusable template tags, potentially customizer settings.
If we decide to go for simple hook -> callback
, we can agree to adopt an FP pattern like Underscores does (one of my favorite when done right) rather than an OO Pattern. Underscores doesn't have tests though and anything which contain logic should have tests for it.
Namely: prefixed global functions.
That triggered my attention, we are going to use namespaces right? If yes, then no need to prefix functions.
from ampnews.
I don't think we should use namespaces for this, necessarily. The goal here is to provide an example theme that will get users up to speed with building an AMP-supporting theme as seamlessly as possible. Using namespaces and OOP and anything else that isn't found in _s could be a barrier to that. So yeah, just prefixed global functions is the normal way to develop a theme that developers are familiar with. We're not trying to create a theme that showcases best practices for modern PHP development. I'm trying to get confirmation, but PHP 5.2 may be required for WordPress.org theme directory as well.
from ampnews.
Roger that.
from ampnews.
Interesting progress on the Servehappy project which is related to this discussion.
from ampnews.
Related Issues (20)
- Create the dynamic secondary featured posts. HOT 2
- Create dynamic more stories section of the single post. HOT 11
- Rework featured images to correspond with the correct image sizes. HOT 11
- Validate Single.php template meets mockups and ACs listed here HOT 1
- Validate header.php and footer.php templates meet mockups and ACs listed here HOT 1
- Validate index.php meets mockups and ACs listed here HOT 1
- Create 404 template and validate that it meet mockups and ACs listed here HOT 1
- Validate comments.php meets mockups and ACs listed here
- Validate that output buffer works as expected each template on render and correctly identifies AMP components HOT 1
- Support a muli-level navigation menu HOT 1
- Validate archive.php (and children templates like category.php) meets mockups and ACs listed here
- Create and validate search templates meets mockups and ACs listed here HOT 1
- Create controls for share buttons, and validate that these meet general mockups and ACs
- Style live list buttons HOT 3
- Fix comment success message styling HOT 2
- Fix "load new articles" when the AMP plugin is disabled HOT 3
- Validation Errors HOT 1
- <style amp-custom></style> is always empty
- Rename theme and repo to AMP News
- Status? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ampnews.