File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
The ` with-automd ` generator generates a benner that notifies docs are updated with automd + the last update time.
4
4
5
- <!-- automd:example generator=with-automd lastUpdate="now" -->
5
+ <!-- automd:example generator=with-automd -->
6
6
7
7
## Example
8
8
9
9
### Input
10
10
11
- <!-- automd:with-automd lastUpdate="now" -->
11
+ <!-- automd:with-automd -->
12
12
<!-- /automd -->
13
13
14
14
### Output
15
15
16
- <!-- automd:with-automd lastUpdate="now" -->
16
+ <!-- automd:with-automd -->
17
17
18
18
---
19
- _🤖 auto updated with [automd](https://automd.unjs.io) (last updated: now)_
19
+
20
+ _🤖 auto updated with [automd](https://automd.unjs.io)_
20
21
21
22
<!-- /automd -->
22
23
23
24
<!-- /automd -->
24
25
25
26
## Arguments
26
27
27
- - ` lastUpdate ` : Can override last updated time. Use ` no-lastUpdate ` to disable.
28
+ - ` lastUpdate ` : Show last updated date. (use string for static value)
28
29
- ` no-separator ` : Disable addition of separator ` --- `
Original file line number Diff line number Diff line change @@ -3,10 +3,9 @@ import { defineGenerator } from "../generator";
3
3
export const withAutomd = defineGenerator ( {
4
4
name : "with-automd" ,
5
5
generate ( { args } ) {
6
- const lastUpdate =
7
- args . lastUpdate === false
8
- ? ""
9
- : ` (last updated: ${ args . lastUpdate || new Date ( ) . toDateString ( ) } )` ;
6
+ const lastUpdate = args . lastUpdate
7
+ ? ` (last updated: ${ typeof args . lastUpdate === "string" ? args . lastUpdate : new Date ( ) . toDateString ( ) } )`
8
+ : "" ;
10
9
11
10
const emoji = args . emoji === false ? "" : "🤖 " ;
12
11
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ import { foo, bar } from "https://esm.sh/pkg";
105
105
106
106
---
107
107
108
- _ 🤖 auto updated with [ automd] ( https://automd.unjs.io ) (last updated: Tue Feb 20 2024) _
108
+ _ 🤖 auto updated with [ automd] ( https://automd.unjs.io ) _
109
109
110
110
<!-- /automd -->
111
111
You can’t perform that action at this time.
0 commit comments