Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schematics/scully/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion schematics/scully/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scullyio/init",
"version": "0.0.4",
"version": "0.0.5",
"description": "Add scully to your angular app",
"repository": {
"type": "GIT",
Expand Down
Binary file added schematics/scully/scullyio-init-0.0.5.tgz
Binary file not shown.
5 changes: 3 additions & 2 deletions schematics/scully/src/create-markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ export default function(options: MyServiceSchema): Rule {
try {
options.name = options.name ? options.name : 'blog';
const name = options.name;
const nameD = strings.dasherize(options.name);
const date = new Date();
const fullDay = `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`;
const path = `./${name}/${fullDay}-${name}.md`;
const path = `./${nameD}/${fullDay}-${nameD}.md`;
if (!host.exists(path)) {
host.create(path, `---
title: This is the ${name}
Expand All @@ -20,7 +21,7 @@ publish: false

# Page ${name} example
`);
context.logger.info(`✅ ${fullDay}-${name} file created`);
context.logger.info(`✅ ${fullDay}-${nameD} file created`);
}

let scullyJson;
Expand Down
5 changes: 3 additions & 2 deletions schematics/scully/src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {apply, forEach, mergeWith, Rule, SchematicContext, Source, Tree} from '@angular-devkit/schematics';
import {strings} from '@angular-devkit/core';

interface Data {
name: string;
Expand All @@ -7,10 +8,10 @@ interface Data {
}

export function addRouteToScullyConfig(scullyConfigJs: string, data: Data) {
const addRoute = `\n '/${data.name}/:${data.slug}': {
const addRoute = `\n '/${strings.dasherize(data.name)}/:${data.slug}': {
type: '${data.type}',
${data.slug}: {
folder: "./${data.name}"
folder: "./${strings.dasherize(data.name)}"
}
},`;
let output;
Expand Down