The development directory of the article module is: ~/blog/work/art/1.0.0
Article management has 3 main pages: Article list/add article/Edit article
1. Templates
ATM rules, template files are unified under the version number under the Views folder
So:
1. Create a views folder below ~/blog/work/art/1.0.0
2. Create a List.ejs/add.ejs/edit.ejs three files under the Views folder
2. Entry file
For these three templates, we set three entry files for List.js/add.js/edit.js
These three entry files are a portal file for future collaboration with the research and development, so ATM rules that the portal files that need to be used in the background need to be placed under the exports folder under the version.
So:
1. Create the exports folder below ~/blog/work/art/1.0.0
2. Create list.js/add.js/edit.js three files under the exports folder
3. View the ID of the portal file after it was built
Visit http://127.0.0.1:1234
Click here on the left,
The right side will appear
On the right you can see three files corresponding to the ID of
Work/art:1.0.0/list
Work/art:1.0.0/add
Work/art:1.0.0/edit
Under the template list is a link to three templates
PS (Local node environment interface is temporarily ugly, will continue to optimize later)
4. Invoking the portal file in the template
To add an article (Add.ejs) (Http://127.0.0.1:1234/dev/work/art/1.0.0/views/add), for example, the code is
<% atmjs.use (' Work/art:1.0.0/add '); %><!doctype html>
So the question is, if I have a version upgrade over time, or the art name has changed, or the work name has changed, wouldn't it be that the entry files in each template will have to be changed?
Oh, we have the countermeasure, we have provided three variable placeholder ($family, $module, $version), pay attention to Add.ejs's access address structure/dev/work/art/1.0.0/views/add
Dev is a local build target, and later documents will mention, for the time being
$family'll change to work.
$module will replace art
$version'll replace 1.0.0.
So we can call the portal file like this
<% atmjs.use (' $family/$module: $version/add '); %>
As of now, the project directory is
2.2-1 Article Module Development