This is a repo which helps to convert figma files to Website. This repo will deploy a static angular website in gh-pages.
{
"files": {
"components": {
"file": "YOUR FIGMA FILE ID for components",
"page": "✅", // node start with this text will be scanned.
"tab": "💻", // node start with this text will be a tab in page
"banner": "🏷️", // node start with this text will be banner in page
"image": "🖼️" // node start with this text will be converted into image
},
"guidelines": {
"file": "YOUR FIGMA FILE ID for guidelines",
"page": "✅",
"tab": "💻",
"banner": "🏷️",
"image": "🖼️"
},
},
"settings": {
"exportImage": {
"format": "svg", // the format we export images
"scale": 1 // the scale of images, for PNG in high resolution devices
},
"fonts": { // pre defined font tag / classnames
"h1":"h1",
"h2":"h2",
"h3":"h3",
"h4":"h4",
"h5":"h5",
"h6":"h6",
"p":"p",
"p_bold":"p_bold",
"p_large":"p_large",
"p_large_bold":"p_large_bold",
"p_small":"p_small",
"a":"a"
},
"containers":{ // node which will be converted into div
"🏷️ banner":"🏷️ banner",
"table":"table",
"table_row":"table_row",
"table_cell":"table_cell"
},
"hyperlinkSeparator":"@@" // the node name with @@ will be convert into a tag. the string after @@ will be the link.
}
}
-
Go to
src/scss/article.scss
to edit the style in article. -
Edit
src/app/app-routing.modules.ts
for navigation
-
Use auto layout for flex layout
-
The '💻' nodes' order will be the tab order
-
Use 'h2' component will creat archor links on the right
-
The page '✅ Index' will create a index/ home page
-
Create new repository secret 'ACTION_TOKEN' with your github personal token.
-
Create new repository secret 'FIGMA_TOKEN' with your figma token.
-
Click 'Run workflow'.
-
Select 'Branch Main'
-
Input your website url into the baseHref input box. (Could be GH-Pages urls or the domain you set)
- Create a file under __local folder.
__local folder/figma.json
- Update figma.json
{
"token": "YOUR TOKEN HERE"
}
-
In CMD / terminal, RUN
npm run figma
to get data -
Run
npm run start
to start local website server.