Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial template.js issues #12

Open
dmitrijLo opened this issue Nov 16, 2020 · 4 comments
Open

initial template.js issues #12

dmitrijLo opened this issue Nov 16, 2020 · 4 comments

Comments

@dmitrijLo
Copy link

there have been some issues with the initial template.js. By the way these arise when going through the "A New Project"-Guide of the microJam pages.

1.) Creating a Markdown-File with "layout": "page" works and initiates styles.css and template.css. But changing the layout to "article" causes an error message "tmpl is not defined".

2.) When using "layout":"index" as explained in "index document" this error occurs: "tmpl.base is not a function".

@dmitrijLo
Copy link
Author

dmitrijLo commented Nov 16, 2020

this could be the issue for 1.):
https://github.com/goessner/microjam/blob/master/microjam.js#L438
image
we already had changed this to const tmpl = module.exports = ...
why is this again?

@dmitrijLo
Copy link
Author

dmitrijLo commented Nov 16, 2020

for the second issue:
@line 49 .base is not defined. this probably should be return tmpl.page(date)
https://github.com/goessner/microjam/blob/master/microjam.js#L486

image

@klawr
Copy link
Collaborator

klawr commented Nov 16, 2020

I would also like to propose the following:

ext.defaults = {
    templates: fs.readFileSync(path.join(
        vscode.extensions.getExtension('goessner.microjam').extensionPath, 'defaults.js'))
        .toString(),
    css: fs.readFileSync(path.join(
        vscode.extensions.getExtension('goessner.microjam').extensionPath, 'defaults.css'))
        .toString(),
};

Basically I just want to put the template strings: https://github.com/goessner/microjam/blob/master/microjam.js#L436
into their own files.

I do think this would make things easier to maintain.

@klawr
Copy link
Collaborator

klawr commented Nov 16, 2020

Respective PR: #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants